/*****************************************************************************
	SNEGA UTILITIES 0.7a
	Copyright (C) 2009, Xiaohan Tian (snega0223)
	
	http://code.google.com/p/snega-utilities/
	
	This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License(LGPL) as
	published by the Free Software Foundation, either version 3 of the 
	License, or(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.
	
	You should have received a copy of the GNU Lesser General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/

package org.sng.util.db.elmt;

import org.sng.util.var.*;
import org.sng.util.web.elmt.RuntimeEnvironment;

public class DataCell extends SVoid {
	
	protected DataRow m_row;
	protected boolean m_changed;
	
	public DataCell()
	{
		this.m_row = null;
		this.m_changed = false;
	}
	
	public DataCell(DataRow row)
	{
		this.m_row = row;
		this.m_changed = false;
	}
	
	public boolean HasChanged()
	{
		return this.m_changed;
	}
	
	protected void Change()
	{
		this.m_changed = true;
		
		if (this.m_row != null)
		{
			this.m_row.Change();
		}
	}
	
	public void SetValue(int n)
	{
		
	}
	
	public void SetValue(double d)
	{
		
	}
	
	public void SetValue(String s)
	{
		
	}
	
	public int GetInt()
	{
		return 0;
	}
	
	public double GetDouble()
	{
		return 0;
	}
	
	public String GetString()
	{
		return "";
	}
	
	public Object Get()
	{
		return null;
	}
	
	// override methods
	public void SetValue(RuntimeEnvironment in, int n)
	{
		this.SetValue(n);
	}
	
	public void SetValue(RuntimeEnvironment in, double d)
	{
		this.SetValue(d);
	}
	
	public void SetValue(RuntimeEnvironment in, String s)
	{
		this.SetValue(s);
	}
	
	public int GetInt(RuntimeEnvironment in)
	{
		return this.GetInt();
	}
	
	public double GetDouble(RuntimeEnvironment in)
	{
		return this.GetDouble();
	}
	
	public String GetString(RuntimeEnvironment in)
	{
		return this.GetString();
	}

}
